<%@ page contentType="text/html; charset=utf-8" %>
<%@ taglib prefix="tiles" uri="http://struts.apache.org/tags-tiles"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="c_rt" uri="http://java.sun.com/jstl/core_rt"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
<%@ taglib prefix="fmt_rt" uri="http://java.sun.com/jstl/fmt_rt"%>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions"%>
<%@ taglib prefix="sql" uri="http://java.sun.com/jsp/jstl/sql"%>
<%@ taglib prefix="x" uri="http://java.sun.com/jsp/jstl/xml"%>
<%@ taglib prefix="x_rt" uri="http://java.sun.com/jstl/xml_rt"%>
<%@ taglib prefix="wr_fn" uri="http://njo.org/taglib/functions"%>
<table width="98%">
  <tr>
    <td class="left"><a name="title"><b>编辑SQL DDL语句</b></a></td>
  </tr>
</table>
<c:set var="actionMessages" value="${wr_fn:amessages(pageContext, '')}"/>
<c:forEach items="${actionMessages}" var="item">
    <div class="error-content">${wr_fn:message(pageContext, item.key, item.values)}</div>
</c:forEach>

<form name="f2" action="${pageContext.request.contextPath}/processor.dts.gt.sql.saveddl.tiles" method="post">
<table class="forum" width="98%">
<col width="100"/>
<col width="*"/>
<tbody>
  <tr>
    <th colspan="2" align="left">概要</th>
  </tr>
  <tr>
    <td>名称:</td>
    <td><input type="text" name="gen_name" value="${ddlgen.gen_name}"/></td>
  </tr>
  <tr>
    <td>TO_KIND:</td>
    <td>
    <select name="gen_to_kind">
<c:forEach items="${to_kind_list}" var="item" varStatus="itemStatus">
    <option value="${item.to_kind}" ${ddlgen.gen_to_kind eq item.to_kind ? "selected" : ""} }>${item.to_kind}</option>
</c:forEach>
    </select>
    </td>
  </tr>
  <tr>
    <td>描述:</td>
    <td><input type="text" name="description" value="${ddlgen.description}"/></td>
  </tr>
</tbody>
</table>
<table class="forum" width="98%">
<col width="10"/>
<col width="150"/>
<col width="*"/>
<tbody>
  <tr>
    <th>&nbsp;</th>
    <th>Name</th>
    <th>Description</th> 
  </tr>
<c:forEach items="${fieldSetList}" var="item" varStatus="itemStatus">
  <tr class="${(itemStatus.index%2==0) ? 'even' : 'odd'}">
    <td><input type="checkbox" name="field_set_physical_name" value="${item.field_set_physical_name}" ${wr_fn:contains(item.field_set_physical_name, ddlgen.field_set_physical_names) ? 'checked': ''}/></td>
    <td><a href="${pageContext.request.contextPath}/processor.loadfieldset.tiles?field_set_physical_name=${item.field_set_physical_name}">${item.field_set_physical_name}</a></td>
    <td class="left">${item.field_set_description}</td>
  </tr>
</c:forEach>
</tbody>
</table>

<table width="98%">
  <tr>
    <td class="right"><input type="button" name="save" value="生成DDL" onclick="javascript:document.f2.action='${pageContext.request.contextPath}/processor.dts.gt.sql.generateddl.tiles'; document.f2.submit();"/><input type="submit" name="save" value="保存"/> <input type="reset" name="reset" value="充填"/></td>
  </tr>
</table>
</form>
